﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Infrastructure.Dao;
using DormMS.Model.Enum;
using DormMS.Model.SearchModels.Activity;
using DormMS.Model.ViewModels;

namespace DormMS.IService
{
    public interface IActivityService
    {
        #region 活动

        /// <summary>
        /// 分页获取活动列表
        /// </summary>
        /// <param name="search"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        IEnumerable<V_Activity> GetActivityList(ActivitySearchModel search, ref int total);

        /// <summary>
        /// 获取活动信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Model.Activity GetActivityInfo(int id);

        /// <summary>
        /// 验证活动名称是否存在
        /// </summary>
        /// <param name="id"></param>
        /// <param name="activityName"></param>
        /// <returns></returns>
        bool CheckActivityName(int id, string activityName);

        /// <summary>
        /// 获取活动信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        V_Activity GetVActivityInfo(int id);

        /// <summary>
        /// 修改活动
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool EditActivity(Model.Activity model);

        /// <summary>
        /// 增加活动
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        int AddActivity(Model.Activity model);

        /// <summary>
        /// 删除活动
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelActivity(int id);

        /// <summary>
        /// 更新活动状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        bool UpdateActivityStatus(int id, int status);

        /// <summary>
        /// 获取第一个详情
        /// </summary>
        /// <returns></returns>
        V_Activity GetActivityTop1();

        /// <summary>
        /// 获取所有的一分钱活动
        /// </summary>
        /// <returns></returns>
        List<V_Activity> GetActivityListAll();

        /// <summary>
        /// 是否能创建团
        /// </summary>
        /// <param name="memberId"></param>
        /// <param name="actId"></param>
        /// <returns></returns>
        bool IsCanCreat(int memberId, int actId);
        /// <summary>
        /// 是否能加入团
        /// </summary>
        /// <param name="memberId"></param>
        /// <param name="actId"></param>
        /// <param name="groupId"></param>
        /// <returns></returns>
        bool IsCanJoin(int memberId, int actId, int groupId);

        #endregion
    }
}
